﻿@namespace MudBlazor.Charts
@using System.Globalization
@inherits MudChartBase

<svg @attributes="UserAttributes" class="mud-chart-donut" width="@ParentWidth" height="@ParentHeight" viewBox="0 0 42 42">
    <Filters />
    <circle class="mud-donut-ring" cx="20" cy="20" r="15.91549430918954"></circle>
    @foreach (var item in _circles.ToList())
    {
        <circle class="mud-chart-serie mud-donut-segment" @onclick="() => SelectedIndex = item.Index"  stroke="@(MudChartParent.ChartOptions.ChartPalette.GetValue(item.Index % ChartOptions.ChartPalette.Count()))"
                cx="@ToS(item.CX)"
                cy="@ToS(item.CY)"
                r="@ToS(item.Radius)"
                stroke-dasharray="@item.StrokeDashArray"
                stroke-dashoffset="@ToS(item.StrokeDashOffset)">
        </circle>
    }
    <circle class="mud-donut-hole" cx="21" cy="21" r="13.4"></circle>

	@MudChartParent?.CustomGraphics
</svg>
<Legend Data="@_legends" />
